using System.Windows.Forms;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace CincinnatiLibraryRenew
{
    public class User
    {
        public string userid;
        public string pin;
        public string name;
        public string email;

        public User(string userid, string pin, string email)
        {
            this.userid = userid;
            this.pin = pin;
            this.email = email;
        }

        public User(params string[] args)
        {
            if (args.Length >= 1)
            {
                this.userid = args[0];
                this.name = this.userid;
            }
            else return;
            if (args.Length >= 2)
                this.pin = args[1];
            else return;
            if (args.Length >= 3)
                this.email = args[2];
        }

        public void StartRenewingItems()
        {
            Thread thread = new Thread(new ThreadStart(RenewItems));
            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
        }

        public void RenewItems()
        {
            Application.Run(new Form1(this));
        }
    }
}
